<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:composition template="/template.xhtml">
	<ui:define name="titulo">jPress - Blog #{sessionBean.selectBlog.nome}</ui:define>
	<ui:define name="body">
		<div id="blog-title">
			<h1 class="blog-name">
				<h:form>
					<p:commandLink action="#{sessionBean.exibeBlog}" ajax="false" style="margin: 0px; padding: 0px;">
						#{sessionBean.selectBlog.nome}
						<f:setPropertyActionListener target="#{sessionBean.selectBlog}" value="#{sessionBean.selectBlog}" />
					</p:commandLink>
				</h:form>								
			</h1>
			<h2 class="blog-titulo">
				#{sessionBean.selectBlog.titulo}
			</h2>
		</div>
		<div id="blog-body">
			<div id="blog-esquerda" class="left">
				<div class="blog-posts">
					<div class="post">
						<div class="post-title">
							#{sessionBean.selectCustomPage.titulo}
						</div>
						<div class="post-texto">
							#{sessionBean.selectCustomPage.conteudo}
						</div>
					</div>
				</div>
			</div>
			<div id="blog-direita" class="right">
				<div class="blog-navegacao">
					<h3>Navegacao</h3>
					<hr />
					<h:form>
						<p:commandLink action="#{sessionBean.exibeBlog}" ajax="false">
							Inicio (internacionalizar)
							<f:setPropertyActionListener target="#{sessionBean.selectBlog}" value="#{sessionBean.selectBlog}" />
						</p:commandLink>
					</h:form>
					<h:form>	
						<ui:repeat var="custompage" value="#{sessionBean.selectBlog.customPages}">
							<p:commandLink action="#{sessionBean.exibeCustomPage}">
								#{custompage.titulo}
								<f:setPropertyActionListener target="#{sessionBean.selectCustomPage}" value="#{custompage}" />
							</p:commandLink><br />
						</ui:repeat>
					</h:form>	
					<div class="blog-navegacao" style="margin-top: 20px;">
						<h3>Posts</h3>
						<hr />
						<h:form>
							<ui:repeat var="post" value="#{sessionBean.selectBlog.posts}">
								<p:commandLink action="#{sessionBean.exibePost}">
									#{post.titulo}
									<f:setPropertyActionListener target="#{sessionBean.selectPost}" value="#{post}" />
								</p:commandLink>
							</ui:repeat>
						</h:form>
					</div>				
				</div>
			</div>
		</div>
	</ui:define>
</ui:composition>
</html>